(1) Field of the Invention
The present invention generally relates to a data backup apparatus of a semiconductor memory, and more particularly to an improvement of a data backup apparatus which executes a data backup routine to retain the latest version of stored data in a semiconductor memory even when power is turned off during writing of data to the memory.
(2) Description of the Related Art
A semiconductor memory coupled to a central processing unit (CPU) includes an array of memory cells, each storing one bit of information. When one or more memory cells of the semiconductor memory malfunction or have defectiveness, the content of the memory cell is destroyed and the stored data is lost. Practically, it is very difficult to produce a semiconductor memory in which any of the memory cells does not malfunction. In a commonly-used semiconductor memory, certain measures against the malfunction of the memory cells, such as data backup, are taken. By taking such measures to the memory, it is ensured that the contents of the memory are correct.
For example, Japanese Laid-Open Patent Application No. 7-192495 discloses an apparatus for testing a semiconductor memory. In this apparatus, the same data is stored in a plurality of memory cells of the semiconductor memory. The apparatus detects whether the values of data read out from the semiconductor device are the same. When the values of the read data are not the same, it is determined that any of the memory cells malfunctions or has defectiveness. When the values of the read data are the same, it is determined that none of the memory cells malfunctions and the stored data is correct.
A nonvolatile semiconductor memory is known which retains its contents when power is turned off. An EEPROM (Electrically Erasable Programmable Read Only Memory) is a type of the nonvolatile semiconductor memory. If data is stored in the nonvolatile semiconductor memory, the stored data can be retained regardless of whether the power is turned on or off.
Suppose that a nonvolatile semiconductor memory in a control unit is installed into an automotive vehicle. Power supplied to the memory is cut off at any time if an ignition switch of the vehicle is turned off by the vehicle operator. It is impossible to predict the timing of the turning off of the ignition switch. Occasionally, the power may be turned off when data is being written to the memory. In such a case, the contents of the memory cells to which the data is being written are incorrect or destroyed, and it is difficult to effectively retain the stored data in the memory.
In the apparatus of the above publication, the same data is written to the plural memory cells of the semiconductor memory at a time. When the semiconductor memory of the above publication is installed into an automotive vehicle, it is possible that the power be turned off when the data is being written to the memory cells of the semiconductor memory. In such a case, the contents of the memory cells to which the data is being written will be incorrect, and the stored data will be lost.
Accordingly, it is difficult that the apparatus of the above publication effectively retains the stored data in the memory when the power is turned off during the writing of data to the memory.